<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- This document is an unofficial reference manual for LaTeX, a
document preparation system, version of October 2018.

This manual was originally translated from LATEX.HLP v1.0a in the
VMS Help Library.  The pre-translation version was written by
George D. Greenwade of Sam Houston State University.  The
LaTeX 2.09 version was written by Stephen Gilmore.  The
LaTeX2e version was adapted from this by Torsten Martinsen.  Karl
Berry made further updates and additions, and gratefully acknowledges
using Hypertext Help with LaTeX, by Sheldon Green, and
LaTeX Command Summary (for LaTeX 2.09) by
L. Botway and C. Biemesderfer (published by the TeX Users
Group as TeXniques number 10), as reference material.  We also
gratefully acknowledge additional material appearing in
latex2e-reference by Martin Herbert Dietze.  (From these references no
text was directly copied.)

Copyright 2007, 2008, 2009, 2010, 2011, 2012, 2013,
2014, 2015, 2016, 2017, 2018 Karl Berry.

Copyright 1988, 1994, 2007 Stephen Gilmore.

Copyright 1994, 1995, 1996 Torsten Martinsen.

Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.


Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided that the entire
resulting derived work is distributed under the terms of a permission
notice identical to this one.

Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions. -->
<!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Overview (LaTeX2e unofficial reference manual (October 2018))</title>

<meta name="description" content="Overview (LaTeX2e unofficial reference manual (October 2018))">
<meta name="keywords" content="Overview (LaTeX2e unofficial reference manual (October 2018))">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="latex2e_0.html#Top" rel="start" title="Top">
<link href="latex2e_30.html#Index" rel="index" title="Index">
<link href="latex2e_0.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="latex2e_0.html#Top" rel="up" title="Top">
<link href="latex2e_3.html#Document-classes" rel="next" title="Document classes">
<link href="latex2e_1.html#About-this-document" rel="prev" title="About this document">
<style type="text/css">
<!--
body {margin: 1em; margin-top: 0px; padding-top: 1px}
a.anchor {float: right}
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>


</head>

<body id="top" lang="en">
<a name="Overview" class="anchor"></a>
<a name="Overview-of-LaTeX" class="anchor"></a>
<h2 class="chapter">Overview of LaTeX</h2>

<a name="index-overview-of-LaTeX" class="anchor"></a>
<a name="index-basics-of-LaTeX" class="anchor"></a>
<a name="index-Knuth_002c-Donald-E_002e" class="anchor"></a>
<a name="index-Lamport_002c-Leslie" class="anchor"></a>
<a name="index-LaTeX-overview" class="anchor"></a>

<p>LaTeX is a system for typesetting documents.  It was originally
created by Leslie Lamport and is now maintained by a group of volunteers
(<a class="external" href="http://latex-project.org">http://latex-project.org</a>).  It is widely used, particularly for
complex and technical documents, such as those involving mathematics.
</p>
<a name="index-macro-package_002c-LaTeX-as" class="anchor"></a>
<p>A LaTeX user writes an input file containing text along with
interspersed commands, for instance commands describing how the text
should be formatted.  It is implemented as a set of related commands
that interface with Donald&nbsp;E. Knuth&rsquo;s TeX typesetting program
(the technical term is that LaTeX is a <em>macro package</em> for the
TeX engine).  The user produces the output document by giving that
input file to the TeX engine.
</p>
<p>The term LaTeX is also sometimes used to mean the language in which
the document is marked up, that is, to mean the set of commands
available to a LaTeX user.
</p>
<a name="index-Lamport-TeX" class="anchor"></a>
<a name="index-pronunciation" class="anchor"></a>
<p>The name LaTeX is short for &ldquo;Lamport TeX&rdquo;.  It is pronounced
LAH-teck or LAY-teck, or sometimes LAY-tecks.  Inside a document,
produce the logo with <code>\LaTeX</code>.  Where use of the logo is not
sensible, such as in plain text, write it as &lsquo;<samp>LaTeX</samp>&rsquo;.
</p>


<hr>
<a name="Starting-and-ending" class="anchor"></a>
<a name="Starting-and-ending-1" class="anchor"></a>
<h3 class="section">Starting and ending</h3>

<a name="Starting-_0026-ending" class="anchor"></a><a name="index-starting-and-ending" class="anchor"></a>
<a name="index-ending-and-starting" class="anchor"></a>
<a name="index-hello_002c-world" class="anchor"></a>

<p>LaTeX files have a simple global structure, with a standard beginning
and ending.  This is a small example.
</p>
<div class="example">
<pre class="example">\documentclass{article}
\begin{document}
Hello, \LaTeX\ world.
\end{document}
</pre></div>

<p>Every LaTeX document has a <code>\begin{document}</code> line and an
<code>\end{document}</code> line.
</p>
<a name="index-document-class_002c-defined" class="anchor"></a>
<p>Here, the &lsquo;<samp>article</samp>&rsquo; is the <em>document class</em>.  It is implemented
in a file <samp>article.cls</samp>.  You can use any document class on your
system.  A few document classes are defined by LaTeX itself, and vast
array of others are widely available.  See <a href="latex2e_3.html#Document-classes">Document classes</a>.
</p>
<a name="index-preamble_002c-defined" class="anchor"></a>
<p>You can include other LaTeX commands between the
<code>\documentclass</code> and the <code>\begin{document}</code> commands.
This area is called the <em>preamble</em>.
</p>
<p>The <code>\begin{document}</code>, <code>\end{document}</code> pair defines an
<a name="index-environment" class="anchor"></a>
<em>environment</em>; the &lsquo;<samp>document</samp>&rsquo; environment (and no others) is
required in all LaTeX documents (see <a href="latex2e_8.html#document">document</a>).  LaTeX make
available to you many environments that are documented here
(see <a href="latex2e_8.html#Environments">Environments</a>).  Many more are available to you from external
packages, most importantly those available at CTAN (see <a href="#CTAN">CTAN</a>).
</p>
<p>The following sections discuss how to produce PDF or other output from
a LaTeX input file.
</p>

<hr>
<a name="Output-files" class="anchor"></a>
<a name="Output-files-1" class="anchor"></a>
<h3 class="section">Output files</h3>

<p>LaTeX produces a main output file and at least two auxiliary files.
The main output file&rsquo;s name ends in either <samp>.dvi</samp> or <samp>.pdf</samp>.
</p>
<dl compact="compact">
<dt><code>.dvi</code></dt>
<dd><a name="index-_002edvi-file" class="anchor"></a>
<a name="index-latex-command" class="anchor"></a>
<a name="index-xdvi-command" class="anchor"></a>
<a name="index-dvips-command" class="anchor"></a>
<a name="index-dvipdfmx-command" class="anchor"></a>
<a name="index-dvitype-command" class="anchor"></a>
<a name="output-files-dvi" class="anchor"></a><p>If LaTeX is invoked with the system command <code>latex</code> then it
produces a DeVice Independent file, with extension <samp>.dvi</samp>.  You
can view this file with a command such as <code>xdvi</code>, or convert
it to a PostScript <code>.ps</code> file with <code>dvips</code> or to a
Portable Document Format <code>.pdf</code> file with <code>dvipdfmx</code>.
The contents of the file can be dumped in human-readable form with
<code>dvitype</code>.  A vast array of other DVI utility programs are
available (<a class="external" href="http://mirror.ctan.org/dviware">http://mirror.ctan.org/dviware</a>).
</p>
</dd>
<dt><code>.pdf</code></dt>
<dd><a name="index-_002epdf-file" class="anchor"></a>
<a name="index-pdfTeX" class="anchor"></a>
<a name="index-pdflatex-command" class="anchor"></a>
<a name="output-files-pdf" class="anchor"></a><p>If LaTeX is invoked via the system command <code>pdflatex</code>,
among other commands (see <a href="#TeX-engines">TeX engines</a>), then the main output is
a Portable Document Format (PDF) file.  Typically this is a
self-contained file, with all fonts and images included.
</p>
</dd>
</dl>

<p>LaTeX also produces at least two additional files.
</p>
<dl compact="compact">
<dt><code>.log</code></dt>
<dd><a name="index-transcript-file" class="anchor"></a>
<a name="index-log-file" class="anchor"></a>
<a name="index-_002elog-file" class="anchor"></a>
<a name="output-files-log" class="anchor"></a><p>This transcript file contains summary information such as a list of
loaded packages.  It also includes diagnostic messages and perhaps
additional information for any errors.
</p>
</dd>
<dt><code>.aux</code></dt>
<dd><a name="index-auxiliary-file" class="anchor"></a>
<a name="index-_002eaux-file" class="anchor"></a>
<a name="index-cross-references_002c-resolving" class="anchor"></a>
<a name="index-forward-references_002c-resolving" class="anchor"></a>
<a name="index-references_002c-resolving-forward" class="anchor"></a>
<a name="output-files-aux" class="anchor"></a><p>Auxiliary information is used by LaTeX for things such as
cross references.  For example, the first time that LaTeX finds a
forward reference&mdash;a cross reference to something that has not yet
appeared in the source&mdash;it will appear in the output as a doubled
question mark <code>??</code>.  When the referred-to spot does eventually
appear in the source then LaTeX writes its location information to
this <code>.aux</code> file.  On the next invocation, LaTeX reads the
location information from this file and uses it to resolve the
reference, replacing the double question mark with the remembered
location.
</p>
</dd>
</dl>

<a name="index-_002elof-file" class="anchor"></a>
<a name="index-list-of-figures-file" class="anchor"></a>
<a name="index-_002elot-file" class="anchor"></a>
<a name="index-list-of-tables-file" class="anchor"></a>
<a name="index-_002etoc-file" class="anchor"></a>
<a name="index-table-of-contents-file" class="anchor"></a>
<a name="index-contents-file" class="anchor"></a>
<p>LaTeX may produce yet more files, characterized by the filename
ending.  These include a <code>.lof</code> file that is used to make a list of
figures, a <code>.lot</code> file used to make a list of tables, and a
<code>.toc</code> file used to make a table of contents (see <a href="latex2e_25.html#Table-of-contents-etc_002e">Table of contents etc.</a>).  A particular class may create others; the list is
open-ended.
</p>

<hr>
<a name="TeX-engines" class="anchor"></a>
<a name="TeX-engines-1" class="anchor"></a>
<h3 class="section">TeX engines</h3>

<a name="index-engines_002c-TeX" class="anchor"></a>
<a name="index-implementations-of-TeX" class="anchor"></a>
<a name="index-UTF_002d8" class="anchor"></a>
<a name="index-Unicode-input_002c-native" class="anchor"></a>
<a name="index-TrueType-fonts" class="anchor"></a>
<a name="index-OpenType-fonts" class="anchor"></a>

<p>LaTeX is defined to be a set of commands that are run by a TeX
implementation (see <a href="#Overview">Overview</a>).  This section gives a terse
overview of the main programs (see also&nbsp;<a href="latex2e_28.html#Command-line">Command line</a>).
</p>
<dl compact="compact">
<dt><code>latex</code></dt>
<dt><code>pdflatex</code></dt>
<dd><a name="index-pdfTeX-engine" class="anchor"></a>
<a name="index-etex-command" class="anchor"></a>
<a name="index-e_002dTeX" class="anchor"></a>
<a name="tex-engines-latex" class="anchor"></a><p>In TeX Live (<a class="external" href="http://tug.org/texlive">http://tug.org/texlive</a>), if LaTeX is invoked
via either the system command <code>latex</code> or <code>pdflatex</code>,
then the pdfTeX engine is run (<a class="external" href="http://ctan.org/pkg/pdftex">http://ctan.org/pkg/pdftex</a>).
When invoked as <code>latex</code>, the main output is a <samp>.dvi</samp>
file; as <code>pdflatex</code>, the main output is a <samp>.pdf</samp> file.
</p>
<p>pdfTeX incorporates the e-TeX extensions to Knuth&rsquo;s original
program (<a class="external" href="http://ctan.org/pkg/etex">http://ctan.org/pkg/etex</a>), including additional
programming features and bi-directional typesetting, and has plenty of
extensions of its own.  e-TeX is available on its own as the system
command <code>etex</code>, but this is plain TeX (and produces
<samp>.dvi</samp>).
</p>
<p>In other TeX distributions, <code>latex</code> may invoke e-TeX
rather than pdfTeX.  In any case, the e-TeX extensions can be
assumed to be available in LaTeX.
</p>
</dd>
<dt><code>lualatex</code></dt>
<dd><a name="index-lualatex-command" class="anchor"></a>
<a name="index-LuaTeX" class="anchor"></a>
<a name="tex-engines-lualatex" class="anchor"></a><p>If LaTeX is invoked via the system command <code>lualatex</code>, the
LuaTeX engine is run (<a class="external" href="http://ctan.org/pkg/luatex">http://ctan.org/pkg/luatex</a>).  This
program allows code written in the scripting language Lua
(<a class="external" href="http://luatex.org">http://luatex.org</a>) to interact with TeX&rsquo;s typesetting.
LuaTeX handles UTF-8 Unicode input natively, can handle OpenType
and TrueType fonts, and produces a <samp>.pdf</samp> file by default.
There is also <code>dvilualatex</code> to produce a <samp>.dvi</samp> file,
but this is rarely used.
</p>
</dd>
<dt><code>xelatex</code></dt>
<dd><a name="index-xelatex-command" class="anchor"></a>
<a name="index-XeTeX" class="anchor"></a>
<a name="index-_002exdv-file" class="anchor"></a>
<a name="index-xdvipdfmx" class="anchor"></a>
<a name="tex-engines-xelatex" class="anchor"></a><p>If LaTeX is invoked with the system command <code>xelatex</code>, the
XeTeX engine is run (<a class="external" href="http://tug.org/xetex">http://tug.org/xetex</a>).  Like LuaTeX,
XeTeX natively supports UTF-8 Unicode and TrueType and OpenType
fonts, though the implementation is completely different, mainly using
external libraries instead of internal code.  XeTeX produces a
<samp>.pdf</samp> file as output; it does not support DVI output.
</p>
<p>Internally, XeTeX creates an <code>.xdv</code> file, a variant of DVI,
and translates that to PDF using the (<code>x</code>)<code>dvipdfmx</code>
program, but this process is automatic.  The <code>.xdv</code> file is only
useful for debugging.
</p>
</dd>
</dl>

<p>Other variants of LaTeX and TeX exist, e.g., to provide
additional support for Japanese and other languages ([u]pTeX,
<a class="external" href="http://ctan.org/pkg/ptex">http://ctan.org/pkg/ptex</a>, <a class="external" href="http://ctan.org/pkg/uptex">http://ctan.org/pkg/uptex</a>).
</p>

<hr>
<a name="LaTeX-command-syntax" class="anchor"></a>
<a name="LaTeX-command-syntax-1" class="anchor"></a>
<h3 class="section">LaTeX command syntax</h3>

<a name="index-command-syntax" class="anchor"></a>
<a name="index-_005c-character-starting-commands" class="anchor"></a>
<a name="index-_005b_002e_002e_002e_005d-for-optional-arguments" class="anchor"></a>
<a name="index-_007b_002e_002e_002e_007d-for-required-arguments" class="anchor"></a>
<p>In the LaTeX input file, a command name starts with a backslash
character, <code>\</code>.  The name itself then consists of either
(a)&nbsp;a string of letters or (b)&nbsp;a single non-letter.
</p>
<p>LaTeX commands names are case sensitive so that <code>\pagebreak</code>
differs from <code>\Pagebreak</code> (the latter is not a standard command).
Most commands are lowercase, but in any event you must enter all
commands in the same case as they are defined.
</p>
<p>A command may be followed by zero, one, or more arguments. These
arguments may be either required or optional.  Required arguments are
contained in curly braces, <code>{...}</code>.  Optional arguments are
contained in square brackets, <code>[...]</code>.  Generally, but not
universally, if the command accepts an optional argument, it comes
first, before any required arguments.
</p>
<p>Inside of an optional argument, to use the character close square
bracket&nbsp;(<code>]</code>) hide it inside curly braces, as
in&nbsp;<code>\item[closing bracket {]}]</code>.  Similarly, if an optional
argument comes last, with no required argument after it, then to make
the first character of the following text be an open square bracket,
hide it inside curly braces.
</p>
<p>Some of LaTeX&rsquo;s commands are a <em>declaration</em>.  Such a command
changes the value the meaning of some other command or parameter.  For
instance, the <code>\mainmatter</code> declaration changes the typesetting of
page numbers from roman numerals to arabic (see <a href="latex2e_6.html#g_t_005cfrontmatter-_0026-_005cmainmatter-_0026-_005cbackmatter">\frontmatter &amp; \mainmatter &amp; \backmatter</a>).
</p>
<p>LaTeX has the convention that some commands have a <code>*</code> form that
is related to the form without a <code>*</code>, such as <code>\chapter</code> and
<code>\chapter*</code>.  The exact difference in behavior varies from command
to command.
</p>
<p>This manual describes all accepted options and <code>*</code>-forms for the
commands it covers (barring unintentional omissions, a.k.a. bugs).
</p>

<hr>
<a name="Environment" class="anchor"></a>
<a name="Environment-1" class="anchor"></a>
<h3 class="section">Environment</h3>

<p>Synopsis:
</p>
<div class="example">
<pre class="example">\begin{<var>environment name</var>}
  ...
\end{<var>environment name</var>}
</pre></div>

<p>An area of LaTeX source, inside of which there is a distinct
behavior.  For instance, for poetry in LaTeX put the lines between
<code>\begin{verse}</code> and <code>\end{verse}</code>.
</p>
<div class="example">
<pre class="example">\begin{verse}
  There once was a man from Nantucket \\
  ...
\end{verse}
</pre></div>

<p>See <a href="latex2e_8.html#Environments">Environments</a> for a list of environments.  Particularly notable is
that every LaTeX document must have a <code>document</code> environment,
a <code>\begin{document} ... \end{document}</code> pair.
</p>
<p>The <var>environment name</var> at the beginning must exactly match that at
the end.  This includes the case where <var>environment name</var> ends in a
star&nbsp;(<code>*</code>); both the <code>\begin</code> and <code>\end</code> texts must
include the star.
</p>
<p>Environments may have arguments, including optional arguments.  This
example produces a table.  The first argument is optional (and causes
the table to be aligned on its top row) while the second argument is
required (it specifies the formatting of columns).
</p>
<div class="example">
<pre class="example">\begin{tabular}[t]{r|l}
  ... rows of table ...
\end{tabular}
</pre></div>


<hr>
<a name="CTAN" class="anchor"></a>
<a name="CTAN_003a-the-Comprehensive-TeX-Archive-Network" class="anchor"></a>
<h3 class="section">CTAN: the Comprehensive TeX Archive Network</h3>

<a name="index-CTAN" class="anchor"></a>

<p>The Comprehensive TeX Archive Network, CTAN, is the TeX and
LaTeX community&rsquo;s repository of free material.  It is a set of
Internet sites around the world that offer material related to LaTeX
for download.  Visit CTAN on the web at <a class="external" href="https://ctan.org">https://ctan.org</a>.
</p>
<p>This material is organized into packages, discrete bundles that
typically offer some coherent functionality and are maintained by one
person or a small number of people.  For instance, many publishers have
a package that allows authors to format papers to that publisher&rsquo;s
specifications.
</p>
<p>In addition to the massive holdings, the web site offers features such
as search by name or by functionality.
</p>
<a name="index-DANTE-e_002eV_002e" class="anchor"></a>
<a name="index-mirrors-of-CTAN" class="anchor"></a>
<p>CTAN is not a single site, but instead is a set of sites. One of the
sites is the core. This site actively manages the material, for
instance, by accepting uploads of new or updated packages. It is
hosted by the German TeX group DANTE e.V. Other sites around the
world help out by mirroring, that is, automatically syncing their
collections with the core site and then in turn making their copies
publicly available. This gives users close to their location better
access and relieves the load on the core site. The list of mirrors is
at <a class="external" href="https://ctan.org/mirrors">https://ctan.org/mirrors</a>.
</p>




</body>
</html>
